<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>收银流水</title>
		<link rel="stylesheet" href="__PEAR__/component/pear/css/pear.css" />
		<style>
		.layui-input{width:150px;}
		.layui-form-label{width:auto;}
		.layui-form-item .layui-input-inline{width: 150px;}
		.inputdiv{display:flex;height: 38px;line-height: 38px;}
		.inputdiv i{position:absolute;right:10px;}
		.layui-table-cell .layui-table-link {color: #ff6a08!important;}}
		</style>
	</head>
	<body class="pear-container">

		<div class="layui-card">
			<div class="layui-card-body" style="min-height: 410px;">
				   <div title="小票预览">
				    <table border="0" width="100%">
				        <tbody>
				        <tr>
				            <td width="15%">
				                分店编码：
				            </td>
				            <td width="35%">
				                <label>{$data['baseflow']['branch_no']}</label>
				            </td>
				            <td width="15%">
				                分店名称：
				            </td>
				            <td width="35%">
				                <label>{$data['baseflow']['branch_name']}</label>
				            </td>
				        </tr>
				        <tr>
				            <td width="15%">
				                营业员：
				            </td>
				            <td>
				                <label>*</label>
				            </td>
				            <td>
				                收银员：
				            </td>
				            <td>
				                <label>{$data['baseflow']['oper_name']}</label>
				            </td>
				        </tr>
				        <tr>
				            <td colspan="1">
				                <label>{$data['baseflow']['flow_no']}</label>
				            </td>
				            <td colspan="3" align="right">
				                <label>{$data['baseflow']['oper_date']}</label>
				            </td>
				        </tr>
				    </tbody></table>
				    <hr>
				    <table id="tbItemList" border="0" cellpadding="0" cellspacing="0" width="100%">
				    	<tbody>
				    	<tr><td>货号</td><td align="right">单价</td><td align="right">数量</td><td align="right">小计</td></tr>
				    	{php}$totalAmt=0;{/php}
				    	{volist name="data['saleflow']" id="vo"}
					    	<tr><td>{$vo['item_no']}</td><td align="right">{$vo['sale_price']}</td><td align="right">{$vo['sale_qnty']}</td><td align="right">{$vo['sale_money']}</td></tr>
					    	<tr><td colspan="4">{$vo['item_name']}</td></tr>
				    	{php}$totalAmt+=$vo['sale_money'];{/php}
				    	{/volist}
				    	</tbody>
				    	</table>
				    <hr>
				    <table border="0" cellpadding="0" cellspacing="0" width="100%">
				        <tbody><tr>
				            <td style="width: 65px;">
				                数量:
				            </td>
				            <td align="left" style="width: 100px;">
				                <label>{$data['saleflow']['length']}</label>
				            </td>
				            <td>
				                合计：
				            </td>
				            <td align="right">
				                <label id="lbSumAmt">{$totalAmt}</label>
				            </td>
				        </tr>
				
				    </tbody></table>
				    <table id="tbPay" border="0" cellpadding="0" cellspacing="0" width="100%">
				    	<tbody>
				    	{volist name="data['payflow']" id="vo"}
				    	<tr><td></td><td></td><td align="right">{$vo['pay_name']}</td><td align="right">{$vo['pay_amount']}</td></tr>
				    	{/volist}
				    	</tbody>
				    </table>
				    {php}
				    	if ($data['baseflow']['sale_way'] == "B")
				        {
				                      $totalAmt =-$totalAmt;
	                    }
				    {/php}
				    {php} if(!empty($data['baseflow']['vip_no'])){ {/php}
				    <table id="tbVip" border="0" cellpadding="0" cellspacing="0" width="100%">
		    				<tr><td style='width: 65px;'>会员卡号：</td>
                                <td align='left'>{$data['baseflow']['vip_no']}</td>
                                <td style='width: 65px;'>本次积分：</td>
                                <td align='left'>{$totalAmt}</td>
		                     </tr>
				    </table>
				    {php} } {/php}
				</div>
				
			</div>
		</div>
		
		<script src="__STATIC__/lib/layui/layui.js"></script>
		<script src="__PEAR__/component/pear/pear.js"></script>
		<script src="__STATIC__/js/admin/common.js"></script>
		<script>
			
			layui.use(['table', 'form', 'jquery','common','laydate'], function() {
				let table = layui.table;
				let form = layui.form;
				let $ = layui.jquery;
				let common = layui.common;
				let laydate = layui.laydate;

				
				window.refresh = function(param) {
					table.reload('saleflow-table');
				}
			})
		</script>
	</body>
</html>
